<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="__PUBLIC__/css/admin/admin_manage.css" />
    <link href="__PUBLIC__/css/table_form.css" rel="stylesheet" type="text/css" />
    <script src='__PUBLIC__/assets/js/jquery.js'></script>
    <script language="javascript" type="text/javascript" src="__PUBLIC__/js/formvalidator.js" charset="UTF-8"></script>
    <script language="javascript" type="text/javascript" src="__PUBLIC__/js/formvalidatorregex.js" charset="UTF-8"></script>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css">
    <script>
        $(function(){
            $.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
            $("#username").formValidator({onshow:"请输入用户名",onfocus:"用户名应该为2-20位之间"}).inputValidator({min:2,max:20,onerror:"用户名应该为2-20位之间"}).ajaxValidator({
                type : "get",
                url : "__URL__/check_username",
                data :"",
                datatype : "json",
                async:'false',
                success : function(data){
                    if( data.status == 0 )
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                },
                buttons: $("#dosubmit"),
                onerror : "用户已存在。",
                onwait : "请稍候..."
            });
            $("#password").formValidator({onshow:"请输入密码",onfocus:"密码应该为6-20位之间"}).inputValidator({min:6,max:20,onerror:"密码应该为6-20位之间"});
            $("#pwdconfirm").formValidator({onshow:"请输入确认密码",onfocus:"请输入两次密码不同。",oncorrect:"密码输入一致"}).compareValidator({desid:"password",operateor:"=",onerror:"请输入两次密码不同。"});
            $("#email").formValidator({onshow:"请输入E-mail",onfocus:"E-mail格式错误",oncorrect:"E-mail格式正确"}).regexValidator({regexp:"email",datatype:"enum",onerror:"E-mail格式错误"});
        })

    </script>
</head>
<body>
<div class="common-form">
    <form name="myform" action="__URL__/add_admin" method="post" id="myform">
        <table width="100%" class="table_form contentWrap">
            <tr>
                <td width="80">用户名</td>
                <td><input type="test" name="username"  class="input-text" id="username"></input></td>
            </tr>
            <tr>
                <td>密码</td>
                <td><input type="password" name="password" class="input-text" id="password" value=""></input></td>
            </tr>
            <tr>
                <td>确认密码</td>
                <td><input type="password" name="pwdconfirm" class="input-text" id="pwdconfirm" value=""></input></td>
            </tr>
            <tr>
                <td>E-mail</td>
                <td>
                    <input type="text" name="email" value="" class="input-text" id="email" size="30"></input>
                </td>
            </tr>
            <tr>
                <td>真实姓名</td>
                <td>
                    <input type="text" name="realname" value="" class="input-text" id="realname"></input>
                </td>
            </tr>
            <tr>
                <td>所属角色</td>
                <td>
                    <select name="role_id">
                        <volist name="roles" id="role">
                            <option value="{$role['id']}" >{$role['name']}</option>
                        </volist>
                    </select>
                </td>
            </tr>
        </table>
        <div class="bk15"></div>
        <input type="hidden" name="info[admin_manage_code]" value="bb6aiTLep3eE4aGqtxTPI19aStmu3pFK8SZ8Rf0fjWmOOg-HL8YX5y3KTQxx5sWlaZgQeAFKj8o" id="admin_manage_code"></input>
        <input name="dosubmit" type="submit" value="提交" class="submit-button bule-button">
    </form>
</div>

</body>
</html>